package com.ce.study.procum;

public class ProducterTh extends Thread {
	private GoodsStock goodsStock;
	private String name;
	private int count = 0;

	public ProducterTh(GoodsStock goodsStock, String name) {
		super(name);
		this.name = name;
		this.goodsStock = goodsStock;
	}

	/*
	 * desc: (non-Javadoc)
	 * 
	 * @see java.lang.Thread#run()
	 */
	@Override
	public void run() {
		while (true) {
			try {
				count++;
				goodsStock.addGoods(name + "-" + count);
				sleep(100);
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
	}

}
